package org.study.redisson.boot.controller;

import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;
import org.study.redisson.boot.model.User;
import org.study.redisson.boot.service.CacheService;

/**
 * 作用描述
 *
 * @author doveylovey
 * @version v1.0.0
 * @email 1135782208@qq.com
 * @date 2024年01月19日
 */
@RequiredArgsConstructor
@RestController
@RequestMapping("/cache")
public class CacheController {
    private final CacheService cacheService;

    @GetMapping("/user/{id}")
    public User queryById(@PathVariable("id") Long id) {
        User user = cacheService.queryById(id);
        return user;
    }
}
